/* 全局样式 */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Fredoka', sans-serif;
    /* -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale; */
    font-weight: normal;
    background: #141E30; /* 深色背景 */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-left: 5%;
    padding-right: 5%;
    padding-top: 60px; 
    box-sizing: border-box; /* 确保padding不会增加body的总尺寸 */
    overflow: hidden; /* 防止整体页面滚动 */
}

/* 通用容器样式 */
.login-container {
    text-align: center;
    background: #243B55; /* 稍浅的深色 */
    border-radius: 10px;
    padding: 20px 40px;
    width: auto;
    max-width: 90%;
    min-width: 300px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    margin-top: -50px; /* 添加负的上边距使容器向上移动 */
}

/* 标题样式 */
h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

/* 表单元素样式 */
input[type="text"],
input[type="password"],
input[type="email"],
button,
select,
textarea {
    font-family: 'Fredoka', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: normal;
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #243B55;
    border-radius: 5px;
    background: #1c1e30; /* 输入框背景 */
    color: #fff;
    font-size: 16px;
    outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    border: 1px solid #ffcc00; /* 聚焦时的高亮颜色 */
    box-shadow: 0 0 5px #ffcc00;
}

/* 按钮样式 */
button {
    width: 80%;
    padding: 10px;
    background: #FFC107; /* 按钮颜色 */
    border: none;
    color: #000000; /* 按钮字体颜色 */
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px 0;
}

button:hover {
    background: #ffdd57;
}

/* 链接样式 */
a {
    color: #ffcc00;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 提示消息样式 */
.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    width: 100%;
}

/* 成功提示消息 */
.flash-success {
    color: #fff;
}

/* 错误提示消息 */
.flash-danger {
    background: #dc3545;
    color: #fff;
}

/* 信息提��消息 */
.flash-info {
    background: #17a2b8;
    color: #fff;
}

/* 警告提示消息 */
.flash-warning {
    background: #ffc107;
    color: #141E30;
    text-align: center;
}

/* 游戏页面特有样式 */
#word-display {
    font-size: 36px;
    margin-bottom: 20px;
}

/* 设置 logo 样式 */
.logo-container {
    position: absolute;
    top: 10px;
    left: 5%;
    display: flex;
    align-items: center;
}

.logo-img {
    width: 33.28px;  /* 40px * 0.832 以保持原始宽高比 */
    height: 40px;
    object-fit: contain;  /* 确保图片保持比例且完整显示 */
}

.logo-text {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: #fff;
    margin-left: 10px;
}

/* 表单元素的状态样式 */
input[type="text"].focused,
input[type="password"].focused,
input[type="email"].focused {
    border: 1px solid #ffcc00;
    box-shadow: 0 0 10px #ffcc00;
}


/* 表单提示消息样式 */
.flash-messages {
    padding: 10px;
    border-radius: 5px;
}

.flash-success {
    background: #28a745;
    color: #ffffff;
}

.flash-danger {
    background: #dc3545;
    color: #ffffff;
}

header {
    width: 100%;
    height: 60px;
    background: #141E30;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-sizing: border-box;
    backdrop-filter: blur(8px);
    background-color: rgba(20, 30, 48, 0.7);
}

/* 更新：中间按钮容器样式 */
.header-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
}

/* 新增：按钮样式 */
.header-button {
    background-color: #0093b8;
    color: #ffffff;
    padding: 8px 16px;
    margin: 0 30px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.header-button:hover {
    background-color: #ffcc00;
    color: #141E30;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

/* 右上角用户信息和登出按钮 */
.user-info {
    display: flex;
    align-items: center;
    position: absolute;
    top: 10px;    
    right: 5%;
}

/* 添加排行榜图标样式 */
.leaderboard-link {
    display: flex;
    align-items: center;
    margin-right: 20px;
    text-decoration: none;
}

.leaderboard-icon {
    width: 32px;
    height: 32px;
    filter: brightness(0) invert(1); /* 默认白色 */
    transition: all 0.3s ease; /* 添加 all 以包含所有属性的过渡 */
}

/* 添加星星跳动动画 */
@keyframes starBounce {
    0% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

/* 更新悬停效果 */
.leaderboard-link:hover .leaderboard-icon {
    animation: starBounce 0.8s ease;
    filter: invert(83%) sepia(53%) saturate(1095%) hue-rotate(359deg) brightness(103%) contrast(103%); /* 转换为#ffcc00黄色 */
}

.username {
    font-size: 16px;
    margin-right: 15px;
}

.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;  /* 减小按钮尺寸 */
    height: 36px; /* 减小按钮尺寸 */
    background: #ffcc00;
    color: #141E30;
    border: none;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s ease;
}

.logout-button:hover {
    background: #ffdd57;
}

.logout-button svg {
    width: 20px;  /* 与SVG元素的宽度一致 */
    height: 20px; /* 与SVG元素的高度一致 */
}


/* 顶部 Logo 样式 */
.logo-container {
    position: absolute;
    top: 10px;
    left: 5%;
    display: flex;
    align-items: center;
}

.logo-img {
    width: 33.28px;  /* 更新宽度以匹配比例 */
    height: 40px;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    color: #fff;
    margin-left: 10px;
}


/* 表单整体样式 */
h2 {
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

/* 设置 label  input 水平排列 */
.row {
    display: flex;              /* 使用 flex 布局 */
    align-items: center;         /* 使 label 和 input 垂中 */
}

.form-label {
    width: 30%;                  /* label 宽度 */
    text-align: right;           /* 文字右对齐 */
    padding-right: 10px;         /* 给 label 和 input 之间留出空隙 */
}

.form-input {
    width: 70%;                  /* input 宽度 */
    padding: 10px;
    border: none;
    border-radius: 5px;
    box-sizing: border-box;
}

/* 鼠标聚焦时的边框效果 */
.form-input:focus {
    outline: none;
    border: 2px solid #00ccff;
}

.btn {
    width: 100%;
    padding: 10px;
    border: none;
    background: #00ccff;
    color: white;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #00b3e6;
}

/* 链接样式 */
a {
    color: #00ccff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}



/* Profile 页面样式 */
.profile-container {
    width: 90%;
    height: calc(100vh - 200px);
    margin: 0 auto;
    padding: 5% 5% 150px 5%; /* 增加底部padding为footer留出空间 */
    display: flex;
    flex-direction: column;
    overflow: hidden;  /* 防止出现滚动条 */
}

.stats-summary {
    display: flex;
    justify-content: space-between; /* 改为 space-between */
    margin-bottom: 40px;
    background: linear-gradient(135deg, #1a2a3d 0%, #253b56 100%);
    padding: 30px;
    border-radius: 20px;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 30%; /* 添加固定宽度 */
    box-sizing: border-box; /* 确保padding不会增加总宽度 */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);

}


.stat-label {
    display: block;
    font-weight: 500;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-value {
    font-size: 2.5em;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 10px;
}

.game-records {
    background-color: #243B55;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-grow: 1;  /* 占据剩余空间 */
    overflow-y: auto;  /* 允许垂直滚动 */
    padding-bottom: 20px;  /* 减少底部padding，因为container已经为footer留出了空间 */
}

.date-group {
    margin-bottom: 20px;
}

.date-group h2 {
    z-index: 1;
    background-color: #30456d;
    color: white;
    padding: 10px;
    margin: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.record-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 添加这行 */
}

.record-row {
    display: table-row;
}

.record-cell {
    display: table-cell;
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid #141E30;
    overflow: hidden; /* 添加这行 */
    text-overflow: ellipsis; /* 添加这行 */
    white-space: nowrap; /* 添加这行 */
    text-align: center;
}

.record-row.header {
    background-color: #1a2a3a;
    font-weight: bold;
}

.record-row.header .record-cell {
    color: #ffcc00;
    border-bottom: 2px solid #ffcc00;
}

.record-time {
    width: 10%;
    padding-left: 20px;
}

.record-creator {
    width: 10%;
}

.record-title {
    width: 15%;
}

.record-description {
    width: 35%;
}

.record-score, .record-completion {
    width: 10%;
}

.record-action {
    width: 10%;
}

.replay-btn {
    padding: 5px 10px;
    font-size: 0.9em;
    background-color: #00ccff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.replay-btn i {
    margin-right: 5px;
}

/* ��保所有表单元素也使用相同的字体 */
input, button, select, textarea {
    font-family: 'Fredoka', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: normal;
}

/* 更新 Footer 样式 */
.site-footer {
    position: fixed;
    bottom: 20px; /* 从底部抬高一点 */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(20, 30, 48, 0.9); /* 稍微透明的背景 */
    color: #fff;
    text-align: center;
    padding: 10px 25px; /* 增加左右内边距 */
    font-size: 14px;
    z-index: 1000;
    border-radius: 25px; /* 圆角 */
    backdrop-filter: blur(8px); /* 背景模糊效果 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* 添加阴影 */
    background-color: rgba(20, 30, 48, 0.5);
    width: auto; /* 自适应宽度 */
    white-space: nowrap; /* 防止文字换行 */
}

.site-footer p {
    margin: 0; /* 移除段落默认边距 */
}

/* 为 Webkit 浏览器（如 Chrome、Safari）添加自定义滚动条样式 */
.game-records::-webkit-scrollbar {
    width: 10px;
}

.game-records::-webkit-scrollbar-track {
    background: #243B55; /* 稍微深一点的背景色 */
}

.game-records::-webkit-scrollbar-thumb {
    background: #00ccff; /* 蓝色滚动条 */
    border-radius: 5px;
}

.game-records::-webkit-scrollbar-thumb:hover {
    background: #00b3e6; /* 鼠标悬停时稍微深一点的蓝色 */
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.logo-link:hover {
    text-decoration: none; /* 添加这一行 */
}

/* Game List 页面样式 */
.game-list-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    margin: 100px auto 200px auto;
    background-color: #243B55;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    padding: 5% 0 5% 0;  /* 移除左右padding，保留上下padding */
    height: calc(100vh - 280px);  /* 设置高度 */
    gap: 20px; 
    align-items: center;
    justify-content: center;

}

.game-list {
    width: 25%;
    background-color: #1a2a3d;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.game-details {
    width: 60%;
    background-color: #1a2a3d;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.game-list:hover, .game-details:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.game-items {
    list-style-type: none;
    padding: 0;
}

.game-item {
    background-color: #2c3e50;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent; /* 添加左边框 */
}

/* Official 游戏样式 */
.game-item.official {
    background-color: #2c3e50;
    border-left-color: #ffcc00; /* 金色边框 */
}

.game-item.official:hover {
    background-color: #34495e;
    box-shadow: 0 2px 8px rgba(255, 204, 0, 0.3); /* 金色阴影 */
}

.game-item.official .game-title {
    color: #ffcc00; /* 金色标题 */
}

/* Temp 游戏样式 */
.game-item.temp {
    background-color: #2c3e50;
    border-left-color: #3498db; /* 蓝色边框 */
}

.game-item.temp:hover {
    background-color: #34495e;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3); /* 蓝色阴影 */
}

.game-item.temp .game-title {
    color: #3498db; /* 蓝色标题 */
}

/* 选中状态样式 */
.game-item.official.selected {
    border: 2px solid #ffcc00;
    border-left: 4px solid #ffcc00;
}

.game-item.temp.selected {
    border: 2px solid #3498db;
    border-left: 4px solid #3498db;
}

.game-date {
    font-size: 0.8em;
    color: #bdc3c7;
}

.game-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #ecf0f1;
}

#game-info {
    background-color: #34495e;
    padding: 5px 20px 5px 20px;  /* Changed top and bottom padding to 5px */
    border-radius: 5px;
    margin-bottom: 20px;
}

#word-list {
    background-color: #2c3e50;
    padding: 20px;
    border-radius: 5px;
}
.game-item.selected {
    border: 2px solid #ffcc00;
}
.word-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #34495e;
}

.word-english {
    font-weight: 300; /* 更细的字体 */
    color: #ffffff; /* 白色 */
}

.word-chinese {
    font-weight: 300; /* 更细的字体 */
    color: #ffffff; /* 白色 */
}

/* 滚动条样式 */
.game-list::-webkit-scrollbar,
.game-details::-webkit-scrollbar {
    width: 8px;
}

.game-list::-webkit-scrollbar-track,
.game-details::-webkit-scrollbar-track {
    background: #1a2a3d;
}

.game-list::-webkit-scrollbar-thumb,
.game-details::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.game-list::-webkit-scrollbar-thumb:hover,
.game-details::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.gc_form-group .form-text {
    display: block;
    margin-top: 5px;
    font-size: 0.9em;
    color: #bdc3c7;
    text-align: left;
}

.journey-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 80px; /* Increased margin-top for more space */
}

.journey-btn {
    background-color: #3498db; /* Blue color */
    color: #fff;
    width: 150px; /* Rectangular button width */
    height: 60px; /* Rectangular button height */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-decoration: none;
    font-size: 16px; /* Smaller font size */
    font-weight: bold;
    text-align: center; /* Center text */
    transition: background-color 0.3s ease;
}

.journey-btn:hover {
    background-color: #2980b9; /* Darker blue on hover */
    text-decoration: none; /* No underline on hover */
}

/* Admin Panel specific styles */
.admin-container {
    margin-top: -60px !important;  /* Reduce top margin */
}

.user-list-table {
    max-height: 400px;  /* Set maximum height */
    overflow-y: auto;   /* Enable vertical scrolling */
}

.user-list-table::-webkit-scrollbar {
    width: 8px;
}

.user-list-table::-webkit-scrollbar-track {
    background: #1a2a3d;
}

.user-list-table::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 4px;
}

.user-list-table::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* 更新 login-button 样式，使其与 header-button 一致 */
.login-button {
    background-color: #0093b8;
    color: #ffffff;
    padding: 8px 16px;
    margin: 0;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-button:hover {
    background-color: #ffcc00;
    color: #141E30;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}